<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<script>

    var row=Number(prompt('请输入打印行数：(请输入奇数)'));
     //正三角形 
     
    for(let i = 1; i < row; i++){
        //每行递增一个*
        for(let j = row; j > i; j--){
            document.write('&nbsp&nbsp');
        }
        for(let j = 0; j < i; j++){
            document.write('&nbsp*&nbsp');
        }   
        document.write('<br />');
    }
    
    //平行四边形 
    for(let i = 1; i < row; i++){

        for(let j = row; j > i; j--){
            document.write('&nbsp&nbsp');
        }
        for(let j = 0; j < row; j++){
            document.write('&nbsp*&nbsp');
        }   
        document.write('<br />');   
    }

    //菱形   
    var s = Math.floor(row/2)+1;
    for(var i=1;i<=row;i++){
        for(var k=1;k<= Math.abs(s-i);k++){
            document.write('&nbsp&nbsp&nbsp');
        }
        for(var j=1;j<= 2*s-1-2*Math.abs(s-i);j++){
            document.write('&nbsp*&nbsp');
        }
        document.write('<br>');
    }



</script>
<body>
    
</body>
</html>